package com.beirtipol.travel.activities.dom;

import com.beirtipol.travel.R;

public enum Line
{
    CENTRAL("Central", R.color.line_central), //
    DISTRICT("District", R.color.line_district), //
    DLR("DLR", R.color.line_dlr), //
    HAMMERSMITH_AND_CITY("Hammersmith And City", R.color.line_hammersmith_and_city), //
    JUBILEE("Jubilee", R.color.line_jubilee), //
    METROPOLITAN("Metropolitan", R.color.line_metropolitan), //
    NORTHERN("Northern", R.color.line_northern), //
    OVERGROUND("Overground", R.color.line_overground), //
    PICADILLY("Piccadilly", R.color.line_picadilly), //
    VICTORIA("Victoria", R.color.line_victoria), //
    WATERLOO_AND_CITY("Waterloo And City", R.color.line_waterloo_and_city);

    private final String name;
    private final int    color;

    private Line(String name, int color)
    {
	this.name = name;
	this.color = color;
    }

    public String getName()
    {
	return name;
    }

    public int getColor()
    {
	return color;
    }

    public static Line parse(String id)
    {
	for (Line line : values())
	{
	    if (line.name.equalsIgnoreCase(id))
	    {
		return line;
	    }
	}
	return null;
    }

    @Override
    public String toString()
    {
	return getName();
    }

}